* FIGURE 2: COMPARE TAX RATES IN OW AND NW 


version 14.0
clear
cap clear matrix
cap log close
cap graph drop _all
set more off
set scheme mygraphs


use "$mypathRR/Datasets/taxrates_cross_canton.dta", clear


cd "/$mypathRR/Results"
local i = 0 
foreach n in 60 300 1000 {
foreach var in einkst_l_`n' {
	
	
local i= `i'+1
  //sum year if estv_`var' !=.
  local minyear = 1990
  local maxyear = 2015

  if `n' == 60 {
  	local mylab "4(2)24"
	local figname "Fig_2c)-"
  }
  else if `n' == 300 {
  	local mylab "4(2)24"
	local figname "Fig_2b)-"

  }
  else if `n' == 1000 {
  	local mylab "4(2)24"
	local figname "Fig_2a)-"

  }
  
  
  foreach kanton in 7 {
  	if `kanton' == 3 {
  	local leg "LU"
  }
  else if `kanton' == 7 {
  	local leg "NW"
  }
	graph twoway (connect estv_`var' year if year>= `minyear' & year<=`maxyear'  & kannr==`kanton') (connect estv_`var' year if year>= `minyear' & year<=`maxyear'  & kannr==6),  ///
	ytitle("Income tax rate (in%)") title("Gross income of CHF `n',000")  xline(2005.5) xline(2007.5, lcolor(green)) ///
	legend(label(1 `leg') label(2 OW) ) ylab(`mylab', grid) xlab(1990(5)2015) xtitle("")
	graph export "`figname'`var'_OW-`leg'.pdf", as(pdf) replace
  }
  
}
}



								* * * * *  E N D  * * * * * * 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
